import { of, zip, zipWith } from "rxjs";

const letters$ = of("A", "B", "C");
const numbers$ = of(1, 2, 3);

letters$.pipe(zipWith(numbers$)).subscribe(([letter, number]) => {
  console.log(`zipWith: ${letter}, ${number}`);
});

// 输出：
// zipWith: A, 1
// zipWith: B, 2
// zipWith: C, 3
zip(letters$, numbers$).subscribe(([letter, number]) => {
  console.log(`zip: ${letter}, ${number}`);
});

// 输出：
// zip: A, 1
// zip: B, 2
// zip: C, 3
